package cn.itcast.controller.system;

import cn.itcast.controller.BaseController;
import cn.itcast.domain.system.Dept;
import cn.itcast.service.system.DeptService;
import cn.itcast.service.system.SysLogService;
import com.github.pagehelper.PageInfo;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.UUID;

///system/dept/list.do
@Controller
@RequestMapping("/system/log")
public class SysLogController extends BaseController {


    @Autowired
    private SysLogService sysLogService;

    @RequestMapping(value = "/list",name = "分页展示日志列表数据")
    public String findAll(@RequestParam(value = "page",required=false,defaultValue ="1" )Integer pageNum,
                          @RequestParam(required=false,defaultValue ="10" )Integer pageSize){
//        分页查询部门数据时要区分是哪个企业的
        PageInfo pageInfo = sysLogService.findPage(getCompanyId(),pageNum,pageSize);
        request.setAttribute("page",pageInfo); //这个“page” 固定不能修改 因为页面上要的就是page这个变量名
        return "system/log/log-list";
    }

}
